]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Pass events to the OSK in dialogs which grab events
authorJonas Dreßler <verdre@v0yd.nl>
Wed, 6 Apr 2022 10:51:45 +0000 (12:51 +0200)
committerMarge Bot <marge-bot@gnome.org>
Sat, 23 Apr 2022 09:42:18 +0000 (09:42 +0000)
With commit c29e0cf6e60a1296b43fc33d94f2acc649046cf9 the grabHelper
already started using a similar mechanism to funnel events to the osk
while a ClutterGrab is in effect. ModalDialog, the unlockDialog and
lookingGlass don't make use of the grabHelper though, they use
Main.pushModal() themselves, so those need to funnel the events to the
OSK themselves.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2263>

js/ui/lookingGlass.js
js/ui/modalDialog.js
js/ui/unlockDialog.js

index 1f10b5a8e4ad34c12710886ceee1add95500bd37..7dea38420922f4e4ec1d950fc84f2cf606115cac 100644 (file)
@@ -1421,6 +1421,13 @@ class LookingGlass extends St.BoxLayout {
         this._resize();
     }
 
+    vfunc_captured_event(event) {
+        if (Main.keyboard.maybeHandleEvent(event))
+            return Clutter.EVENT_STOP;
+
+        return Clutter.EVENT_PROPAGATE;
+    }
+
     _updateFont() {
         let fontName = this._interfaceSettings.get_string('monospace-font-name');
         let fontDesc = Pango.FontDescription.from_string(fontName);
index 9d5521be93e904319bbddc126590e02252885f9e..04c0cf8ca445d00323546f394645386772325012 100644 (file)
@@ -114,6 +114,13 @@ var ModalDialog = GObject.registerClass({
         return Clutter.EVENT_PROPAGATE;
     }
 
+    vfunc_captured_event(event) {
+        if (Main.keyboard.maybeHandleEvent(event))
+            return Clutter.EVENT_STOP;
+
+        return Clutter.EVENT_PROPAGATE;
+    }
+
     clearButtons() {
         this.dialogLayout.clearButtons();
     }
index 866513c46044516326281cf1a47f07d3967a8c05..dd13e312bdcbc43dbd8a4d966533bd10707c2196 100644 (file)
@@ -625,6 +625,13 @@ var UnlockDialog = GObject.registerClass({
         return Clutter.EVENT_PROPAGATE;
     }
 
+    vfunc_captured_event(event) {
+        if (Main.keyboard.maybeHandleEvent(event))
+            return Clutter.EVENT_STOP;
+
+        return Clutter.EVENT_PROPAGATE;
+    }
+
     _createBackground(monitorIndex) {
         let monitor = Main.layoutManager.monitors[monitorIndex];
         let widget = new St.Widget({